include(../sdk.pri)
TEMPLATE = lib
CONFIG += qt \
    thread \
    precompile_header
QT += network \
    xml \
    core \
    sql \
    gui \
    webkit
DEFINES *= OPTRA_SDK_LIBRARY \
    OPTRAVERSION=$$SDK_VERSION

# VERSION=$$SDK_VERSION
SDK_INSTALL_PREFIX = c:/tmp
PREFIX = $$SDK_INSTALL_PREFIX

# source section
SDK_INCLUDEPATH = $$SDK_ROOT/include/optra
SDK_SOURCEPATH = $$SDK_ROOT/src
DEPENDPATH += $$INCLUDEPATH
DEPENDPATH += $$SDK_SOURCEPATH
PRECOMPILED_HEADER = $$SDK_SOURCEPATH/pch.h

# common Headers
C_HEADERS += $$SDK_INCLUDEPATH/common/global.h \
    $$SDK_INCLUDEPATH/common/common.h \
    $$SDK_INCLUDEPATH/common/sdk.h \
    $$SDK_INCLUDEPATH/common/db.h \
    $$SDK_INCLUDEPATH/common/gui.h \
    $$SDK_INCLUDEPATH/common/guiwindow.h \
    $$SDK_INCLUDEPATH/common/logevent.h \
    $$SDK_INCLUDEPATH/common/proxy.h
common1.files = $$C_HEADERS
common1.path = $$PREFIX/include/optra/common

INSTALLS += common1
common2.files = $$SDK_INCLUDEPATH/all \
    $$SDK_INCLUDEPATH/all.h
common2.path = $$PREFIX/include/optra

INSTALLS += common2
HEADERS += $$C_HEADERS \
    $$SDK_SOURCEPATH/pch.h \
    $$SDK_INCLUDEPATH/all \
    $$SDK_INCLUDEPATH/all.h

# common sources
SOURCES += $$SDK_SOURCEPATH/db.cpp \
    $$SDK_SOURCEPATH/gui.cpp \
    $$SDK_SOURCEPATH/guiwindow.cpp \
    $$SDK_SOURCEPATH/logevent.cpp \
    $$SDK_SOURCEPATH/proxy.cpp

optra-zones {
    # message(Build Zones SDK)
    Z_HDRD = $$SDK_INCLUDEPATH/zones/optra
    Z_HEADERS = $$Z_HDRD/zones \
        $$Z_HDRD/zones.h \
        $$Z_HDRD/zoneinfo.h \
        $$Z_HDRD/zoneinterface.h
    HEADERS += $$Z_HEADERS
    SOURCES += $$SDK_SOURCEPATH/zones/zoneinfo.cpp \
        $$SDK_SOURCEPATH/zones/zoneinterface.cpp
    zones.files = $$Z_HEADERS
    zones.path = $$PREFIX/include/optra/zones/optra
    INSTALLS += zones
}
optra-applications {
    # message(Build Appliations SDK)
    A_HDRD = $$SDK_INCLUDEPATH/applications/optra
    A_HEADERS = $$A_HDRD/applications \
        $$A_HDRD/applications.h \
        $$A_HDRD/applicationinfo.h \
        $$A_HDRD/appoptrainfo.h
    HEADERS += $$A_HEADERS
    SOURCES += $$SDK_SOURCEPATH/applications/applicationinfo.cpp \
        $$SDK_SOURCEPATH/applications/appoptrainfo.cpp
    applications.files = $$A_HEADERS
    applications.path = $$PREFIX/include/optra/applications/optra
    INSTALLS += applications
}
CONFIG(staticlib, dll|staticlib): {
    message(Static Build)
    CONFIG -= dll
}
else:CONFIG *= dll
DESTDIR = $$SDK_LIB_DIR
DLLDESTDIR = $$SDK_BIN_DIR
TARGET = $$SDK_TARGET_NAME

